package DataAccess;

//////////////////////////////////////////////////////////////////////////
// �� �� ��: Bank.cs
// �� �� ��: otyg
// ��������: DateTime.Now();
// ��    ��: ��װ���ݱ�[Bank]��ز���
// ģ���޸�: 
//     2006-11-17  ֧��ChangePage�ؼ���ֻװ�ص�ǰҳ���ݹ���
//     2006-10-28  ����ͨ��DataRowView���쵥��������
//     2006-10-16  ���뼯�ϲ���foreach/Add/Remove�ȹ���,����Transaction����
// ��    Ȩ: ���������  QQ:1775068  
//////////////////////////////////////////////////////////////////////////
/** 
 Data Access Layer Object Of Bank
*/
public class Bank extends DataAccessBase
{
//C# TO JAVA CONVERTER TODO TASK: There is no preprocessor in Java:
		///#region ����ͻ���
	public Bank()
	{
		super();
		_DataRow.setItem("Hy_Num", 0);
		_DataRow.setItem("Hy_Name", "");
		_DataRow.setItem("Input_Money", 0);
		_DataRow.setItem("Output_Money", 0);
		_DataRow.setItem("Balance", 0);
		_DataRow.setItem("zt", "");
		_DataRow.setItem("RealName", "");
		_DataRow.setItem("BankName", "");
		_DataRow.setItem("CardCode", "");
		_DataRow.setItem("addtime", java.time.LocalDateTime.MIN);
		_DataRow.setItem("sheng", "");
		_DataRow.setItem("shi", "");
		_DataRow.setItem("zhihang", "");
		_DataRow.setItem("shengfzh", "");
		_DataRow.setItem("zhifumima", "");
		_DataRow.setItem("zhifubao", "");
		_DataRow.setItem("ifedit", "");
		_DataRow.setItem("shenfenzheng", "");
	}
	public Bank(DataRow dataRow)
	{
		super(dataRow);
	}
	public Bank(DataRowView dataRowView)
	{
		super(dataRowView);
	}
	@Override
	protected DataRow BuildRow()
	{
		DataTable dt = new DataTable();
		dt.Columns.Add("Hy_Num",Integer.class);
		dt.Columns.Add("Hy_Name",String.class);
		dt.Columns.Add("Input_Money",java.math.BigDecimal.class);
		dt.Columns.Add("Output_Money",java.math.BigDecimal.class);
		dt.Columns.Add("Balance",java.math.BigDecimal.class);
		dt.Columns.Add("zt",String.class);
		dt.Columns.Add("RealName",String.class);
		dt.Columns.Add("BankName",String.class);
		dt.Columns.Add("CardCode",String.class);
		dt.Columns.Add("addtime",java.time.LocalDateTime.class);
		dt.Columns.Add("sheng",String.class);
		dt.Columns.Add("shi",String.class);
		dt.Columns.Add("zhihang",String.class);
		dt.Columns.Add("shengfzh",String.class);
		dt.Columns.Add("zhifumima",String.class);
		dt.Columns.Add("zhifubao",String.class);
		dt.Columns.Add("ifedit",String.class);
		dt.Columns.Add("shenfenzheng",String.class);
		return dt.NewRow();
	}
//C# TO JAVA CONVERTER TODO TASK: There is no preprocessor in Java:
		///#endregion ����ͻ���
//C# TO JAVA CONVERTER TODO TASK: There is no preprocessor in Java:
		///#region ����
	public final DataRow getDataRow()
	{
		return super._DataRow;
	}
	public final int getHy_Num()
	{
		return Integer.parseInt(_DataRow.getItem("Hy_Num").toString());
	}
	public final void setHy_Num(int value)
	{
		_DataRow.setItem("Hy_Num", value);
	}
	public final String getHy_Name()
	{
		return _DataRow.getItem("Hy_Name").toString();
	}
	public final void setHy_Name(String value)
	{
		_DataRow.setItem("Hy_Name", value);
	}
	public final java.math.BigDecimal getInput_Money()
	{
		return java.math.BigDecimal.Parse(_DataRow.getItem("Input_Money").toString());
	}
	public final void setInput_Money(java.math.BigDecimal value)
	{
		_DataRow.setItem("Input_Money", value);
	}
	public final java.math.BigDecimal getOutput_Money()
	{
		return java.math.BigDecimal.Parse(_DataRow.getItem("Output_Money").toString());
	}
	public final void setOutput_Money(java.math.BigDecimal value)
	{
		_DataRow.setItem("Output_Money", value);
	}
	public final java.math.BigDecimal getBalance()
	{
		return java.math.BigDecimal.Parse(_DataRow.getItem("Balance").toString());
	}
	public final void setBalance(java.math.BigDecimal value)
	{
		_DataRow.setItem("Balance", value);
	}
	public final String getzt()
	{
		return _DataRow.getItem("zt").toString();
	}
	public final void setzt(String value)
	{
		_DataRow.setItem("zt", value);
	}
	public final String getRealName()
	{
		return _DataRow.getItem("RealName").toString();
	}
	public final void setRealName(String value)
	{
		_DataRow.setItem("RealName", value);
	}
	public final String getBankName()
	{
		return _DataRow.getItem("BankName").toString();
	}
	public final void setBankName(String value)
	{
		_DataRow.setItem("BankName", value);
	}
	public final String getCardCode()
	{
		return _DataRow.getItem("CardCode").toString();
	}
	public final void setCardCode(String value)
	{
		_DataRow.setItem("CardCode", value);
	}
	public final java.time.LocalDateTime getaddtime()
	{
		return java.time.LocalDateTime.parse(_DataRow.getItem("addtime").toString());
	}
	public final void setaddtime(java.time.LocalDateTime value)
	{
		_DataRow.setItem("addtime", value);
	}
	public final String getsheng()
	{
		return _DataRow.getItem("sheng").toString();
	}
	public final void setsheng(String value)
	{
		_DataRow.setItem("sheng", value);
	}
	public final String getshi()
	{
		return _DataRow.getItem("shi").toString();
	}
	public final void setshi(String value)
	{
		_DataRow.setItem("shi", value);
	}
	public final String getzhihang()
	{
		return _DataRow.getItem("zhihang").toString();
	}
	public final void setzhihang(String value)
	{
		_DataRow.setItem("zhihang", value);
	}
	public final String getshengfzh()
	{
		return _DataRow.getItem("shengfzh").toString();
	}
	public final void setshengfzh(String value)
	{
		_DataRow.setItem("shengfzh", value);
	}
	public final String getzhifumima()
	{
		return _DataRow.getItem("zhifumima").toString();
	}
	public final void setzhifumima(String value)
	{
		_DataRow.setItem("zhifumima", value);
	}
	public final String getzhifubao()
	{
		return _DataRow.getItem("zhifubao").toString();
	}
	public final void setzhifubao(String value)
	{
		_DataRow.setItem("zhifubao", value);
	}
	public final String getifedit()
	{
		return _DataRow.getItem("ifedit").toString();
	}
	public final void setifedit(String value)
	{
		_DataRow.setItem("ifedit", value);
	}
	public final String getshenfenzheng()
	{
		return _DataRow.getItem("shenfenzheng").toString();
	}
	public final void setshenfenzheng(String value)
	{
		_DataRow.setItem("shenfenzheng", value);
	}
//C# TO JAVA CONVERTER TODO TASK: There is no preprocessor in Java:
		///#endregion ����
//C# TO JAVA CONVERTER TODO TASK: There is no preprocessor in Java:
		///#region ��������
	protected final boolean DeleteByCondition(String condition)
	{
		String sql = "" + "\r\n" +
"				Delete From Bank" + "\r\n" +
"				WHERE " + condition;
//C# TO JAVA CONVERTER TODO TASK: There is no preprocessor in Java:
//#if(DEBUG)
		super.ExecuteSQL(sql);
//#else
		try
		{
			super.ExecuteSQL(sql);
		}
		catch (java.lang.Exception e)
		{
			return false;
		}
//#endif
		return true;
	}
	public final boolean Delete(int Hy_Num)
	{
		String condition = "Hy_Num=" + String.valueOf(Hy_Num);
		return DeleteByCondition(condition);
	}
	public final boolean Delete()
	{
		String condition = "Hy_Num=" + String.valueOf(getHy_Num());
		return DeleteByCondition(condition);
	}
	public final boolean Insert()
	{
			String sql = "" + "\r\n" +
"				Insert Into Bank (" + "\r\n" +
"\r\n" +
"					Hy_Name," + "\r\n" +
"					Input_Money," + "\r\n" +
"					Output_Money," + "\r\n" +
"					Balance," + "\r\n" +
"					zt," + "\r\n" +
"					RealName," + "\r\n" +
"					BankName," + "\r\n" +
"					CardCode," + "\r\n" +
"					addtime," + "\r\n" +
"					sheng," + "\r\n" +
"					shi," + "\r\n" +
"					zhihang," + "\r\n" +
"					shengfzh," + "\r\n" +
"					zhifumima," + "\r\n" +
"					zhifubao," + "\r\n" +
"					ifedit," + "\r\n" +
"					shenfenzheng" + "\r\n" +
"				) Values (" + "\r\n" +
"\r\n" +
"					" + Helper.ToSQLParamStr(getHy_Name()) + "," + "\r\n" +
"					" + getInput_Money() + "," + "\r\n" +
"					" + getOutput_Money() + "," + "\r\n" +
"					" + getBalance() + "," + "\r\n" +
"					" + Helper.ToSQLParamStr(getzt()) + "," + "\r\n" +
"					" + Helper.ToSQLParamStr(getRealName()) + "," + "\r\n" +
"					" + Helper.ToSQLParamStr(getBankName()) + "," + "\r\n" +
"					" + Helper.ToSQLParamStr(getCardCode()) + "," + "\r\n" +
"					" + Helper.ToSQLParamStr(getaddtime().toString()) + "," + "\r\n" +
"					" + Helper.ToSQLParamStr(getsheng()) + "," + "\r\n" +
"					" + Helper.ToSQLParamStr(getshi()) + "," + "\r\n" +
"					" + Helper.ToSQLParamStr(getzhihang()) + "," + "\r\n" +
"					" + Helper.ToSQLParamStr(getshengfzh()) + "," + "\r\n" +
"					" + Helper.ToSQLParamStr(getzhifumima()) + "," + "\r\n" +
"					" + Helper.ToSQLParamStr(getzhifubao()) + "," + "\r\n" +
"					" + Helper.ToSQLParamStr(getifedit()) + "," + "\r\n" +
"					" + Helper.ToSQLParamStr(getshenfenzheng()) + "\r\n" +
"				)";
//C# TO JAVA CONVERTER TODO TASK: There is no preprocessor in Java:
//#if(DEBUG)
		super.ExecuteSQL(sql);
//#else
		try
		{
			super.ExecuteSQL(sql);
		}
		catch (java.lang.Exception e)
		{
			return false;
		}
//#endif
		return true;
	}
	protected final boolean SelectByCondition(String condition)
	{
		String sql = "" + "\r\n" +
"				Select" + "\r\n" +
"					Hy_Num," + "\r\n" +
"					Hy_Name," + "\r\n" +
"					Input_Money," + "\r\n" +
"					Output_Money," + "\r\n" +
"					Balance," + "\r\n" +
"					zt," + "\r\n" +
"					RealName," + "\r\n" +
"					BankName," + "\r\n" +
"					CardCode," + "\r\n" +
"					addtime," + "\r\n" +
"					sheng," + "\r\n" +
"					shi," + "\r\n" +
"					zhihang," + "\r\n" +
"					shengfzh," + "\r\n" +
"					zhifumima," + "\r\n" +
"					zhifubao," + "\r\n" +
"					ifedit," + "\r\n" +
"					shenfenzheng" + "\r\n" +
"				  From Bank" + "\r\n" +
"				 Where " + condition + "\r\n" +
"			";
		DataTable dt;
//C# TO JAVA CONVERTER TODO TASK: There is no preprocessor in Java:
//#if(DEBUG)
		dt = super.GetDataTable(sql);
//#else
		try
		{
			dt = super.GetDataTable(sql);
		}
		catch (java.lang.Exception e)
		{
			return false;
		}
//#endif
		try
		{
			_DataRow = dt.Rows[0];
		}
		catch (java.lang.Exception e2)
		{
			return false;
		}
		return true;
	}
	public final boolean SelectByPk(int Hy_Num)
	{
		String condition = "1=1" + "\r\n" +
"				   And Hy_Num=" + String.valueOf(Hy_Num) + "\r\n" +
"			";
		return SelectByCondition(condition);
	}
	public final boolean Update()
	{
		String sql = "" + "\r\n" +
"				Update Bank SET" + "\r\n" +
"					Hy_Name=" + Helper.ToSQLParamStr(getHy_Name()) + "," + "\r\n" +
"					Input_Money=" + getInput_Money() + "," + "\r\n" +
"					Output_Money=" + getOutput_Money() + "," + "\r\n" +
"					Balance=" + getBalance() + "," + "\r\n" +
"					zt=" + Helper.ToSQLParamStr(getzt()) + "," + "\r\n" +
"					RealName=" + Helper.ToSQLParamStr(getRealName()) + "," + "\r\n" +
"					BankName=" + Helper.ToSQLParamStr(getBankName()) + "," + "\r\n" +
"					CardCode=" + Helper.ToSQLParamStr(getCardCode()) + "," + "\r\n" +
"					addtime=" + Helper.ToSQLParamStr(getaddtime().toString()) + "," + "\r\n" +
"					sheng=" + Helper.ToSQLParamStr(getsheng()) + "," + "\r\n" +
"					shi=" + Helper.ToSQLParamStr(getshi()) + "," + "\r\n" +
"					zhihang=" + Helper.ToSQLParamStr(getzhihang()) + "," + "\r\n" +
"					shengfzh=" + Helper.ToSQLParamStr(getshengfzh()) + "," + "\r\n" +
"					zhifumima=" + Helper.ToSQLParamStr(getzhifumima()) + "," + "\r\n" +
"					zhifubao=" + Helper.ToSQLParamStr(getzhifubao()) + "," + "\r\n" +
"					ifedit=" + Helper.ToSQLParamStr(getifedit()) + "," + "\r\n" +
"					shenfenzheng=" + Helper.ToSQLParamStr(getshenfenzheng()) + "\r\n" +
"				Where 1=1" + "\r\n" +
" 				  And Hy_Num= " + String.valueOf(getHy_Num()) + "\r\n" +
"				";
//C# TO JAVA CONVERTER TODO TASK: There is no preprocessor in Java:
//#if(DEBUG)
		return (super.ExecuteSQL(sql) >= 1);
//#else
		try
		{
			return (super.ExecuteSQL(sql) == 1);
		}
		catch (java.lang.Exception e)
		{
			return false;
		}
//#endif
	}

//C# TO JAVA CONVERTER TODO TASK: There is no preprocessor in Java:
		///#endregion ��������
//C# TO JAVA CONVERTER TODO TASK: There is no preprocessor in Java:
		///#region ���淽��
	//TODO: �����ķ������������
//C# TO JAVA CONVERTER TODO TASK: There is no preprocessor in Java:
		///#endregion ���淽��
}